package cn.kgc.biz.cronTrigger;

import cn.kgc.mapper.HotelOrderMapper;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class QuartzCronTriggerJob {
    @Resource
    private HotelOrderMapper hotelOrderMapper;
    @Scheduled(cron = "0 0/3 * * * ?")
    public void executeCancelOrder() {
        hotelOrderMapper.cancelOrderByCreationDate();
        System.out.println("执行成功！");
    }
    @Scheduled(cron = "0 0 12 * * ?")
    public void updateOrderStatus(){
        hotelOrderMapper.updateOrderStatusByCheckoutDate();
    }
}
